//
//  HSSearchBar.m
//  01-黑马微博
//
//  Created by lanou3g on 15/9/7.
//  Copyright (c) 2015年 heima. All rights reserved.
//

#import "HWSearchBar.h"

@implementation HWSearchBar


- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
//        UITextField *searchBar = [[UITextField alloc] init];
//        searchBar.width = 300;
//        searchBar.height = 30;
        self.font = [UIFont systemFontOfSize:14];
        self.placeholder = @"请输入内容";
        self.background = [UIImage imageNamed:@"searchbar_textfield_background"];
        //    设置左边的放大镜图标
        UIImageView *searchIcon = [[UIImageView alloc] init];
        searchIcon.image = [UIImage imageNamed:@"searchbar_textfield_search_icon"];
        searchIcon.width = 30;
        searchIcon.height = 30;
        searchIcon.contentMode = UIViewContentModeCenter;
        self.leftView = searchIcon;
        self.leftViewMode =  UITextFieldViewModeAlways;
    }
    return self;
}
+ (instancetype)searchBar{
    return [[self alloc] init];
}

@end
